/**
 * 
 */
package patterns.observer;

/**
 * @author gabriel
 *
 */
public class ConcreteObserver implements Observer {

	private String name= "";
	private Subject subject= null;
	/**
	 * 
	 */
	public ConcreteObserver() {
			name= "generico";
	}
	
	public ConcreteObserver(String name){
		this.name=name;
	}

	public ConcreteObserver(Subject subject, String name){
		this.name=name;
		this.subject=subject;
		subject.registerObserver(this);
	}
	
	/* (non-Javadoc)
	 * @see patterns.observer.Observer#update()
	 */
	@Override
	public void update() {
		System.out.println("Actualizado generico observador: "+name);

	}

	@Override
	public void update(String item) {
		System.out.println("Actualizado generico item: "+item+ " name: "+name);		
	}

}
